﻿#include "PropTipManager.h"
#include "PropTip.h"
PropTipManager::PropTipManager() {

}

PropTipManager::~PropTipManager() {
	pInstance = nullptr;
}

PropTipManager* PropTipManager::pInstance = nullptr;

void PropTipManager::addPropTip(PropTip* propTip) {
	propTipList.push_back(propTip);
}

void PropTipManager::collection(PropTip* propTip) {
	propTipList.remove(propTip);
	propTip->removeFromParent();
}

void PropTipManager::clearList() {
	propTipList.clear();
}

bool PropTipManager::isPropInPropTip(PropType type) {
	if (propTipList.empty()) return false;
	for (PropTip* propTip : propTipList) {
		if (propTip->getPropType() == type) {
			return true;
		}
	}
	return false;
}
